package com.nus.fellowmark.config;

import cn.dev33.satoken.interceptor.SaInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Ruoyi Chen
 * @email chenruoyisz@gmail.com
 * @create 2023/2/11
 */
@Configuration
public class AuthConfigurer implements WebMvcConfigurer {
    /**
     *     Register the Sa-Token interceptor and enable the annotation authentication function
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new SaInterceptor()).addPathPatterns("/**");
    }
}
